Skip to content

Webui - further improvements - #41

Merged
bobjansen merged 4 commits into
mainfrom
webui
Aug 29, 2026
Merged

Webui - further improvements#41
bobjansen merged 4 commits into
mainfrom
webui

Conversation

@bobjansen

Copy link
Copy Markdown
Owner

No description provided.

bobjansen and others added 2 commits August 29, 2026 18:05
`symbol` in gen_ticks is a handful of distinct values over up to millions of
rows — the case dictionary encoding exists for. The row->code vector is
exactly the `symbol_idx` the generator already builds, so this is nearly free
and also drops the per-row string push. gen_reference's string columns
(symbol, name, sector, currency) follow so a join key matches by type and
gathering those columns across a join copies codes, not strings.

Measured, 10M-row `gen_ticks`, single-threaded native:
- group-by by symbol: ~135 ms -> a few ms
- (trades join reference on symbol)[agg, by {symbol, name}]: ~950 ms -> ~490 ms
  (join 566->168 ms, 2-key aggregate 391->22 ms)

The residual join cost is unpruned columns — eager pipelines don't get the
projection pushdown the lazy/parquet path does (repl.cpp:4819). Separate issue.

All 1808 tests pass.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UF1k31UD7JHZujGtgHj57H
gen_ticks walked a single shared price for every row, so `mean(price)` by
symbol converged to the same number — five samples of one trajectory. The
doc comment already claimed "random walk per symbol"; now it's true.

Each symbol gets a distinct base price (seeded uniform, 0.6x–2.4x
start_price) and its own mean-reverting walk. Reversion is needed because a
pure additive walk's variance grows with the row count, so at the millions
of rows this generator targets the levels would diverge and then read as
noise. Example, 50k rows, seed 42: MSFT ~89, NVDA ~130, AAPL ~147,
AMZN ~187, GOOG ~229.

1808 tests pass.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UF1k31UD7JHZujGtgHj57H
@bobjansen bobjansen self-assigned this Aug 29, 2026
bobjansen and others added 2 commits August 29, 2026 18:21
The iterator-pair `std::vector<int32_t>(int64_begin, int64_end)` constructor
tripped MSVC's C4244 (int64->int32) under /WX. Fill the code vector with an
explicit static_cast instead; values are 0..names.size()-1.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UF1k31UD7JHZujGtgHj57H
Recaptured against the current build. The group-by of 10M ticks by symbol
dropped from ~101 ms to ~9 ms (Categorical symbol key), generation from
~581 ms to ~261 ms, and the per-symbol prices are now distinct (NVDA ~212,
MSFT ~175, AAPL ~80) instead of all landing on ~279. Added a link from the
caption to the live browser Playground.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UF1k31UD7JHZujGtgHj57H
@bobjansen
bobjansen merged commit 4b9da30 into main Aug 29, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant